var qj_dx,qj_xsdx,qj_classdx;
window.onload=function(){
	qj_dx = document.getElementById("box");
	qj_xsdx = document.getElementsByTagName("input");
	qj_classdx = document.getElementsByClassName("mytmxs");
	
	var nr = localStorage.getItem("zbx_tm1");
	if(nr.length>0){JsBarcode("#tm1",nr,{height:30,width:1});qj_xsdx[0].value=nr;}
	
	nr = localStorage.getItem("zbx_tm2");
	if(nr.length>0){JsBarcode("#tm2",nr,{height:30,width:1});qj_xsdx[1].value=nr;}
	
}

window.onresize=function(){
	
	var h = document.body.clientHeight;
	var w = document.body.clientWidth;
	
	if(h<390){
		
		qj_dx.style.marginTop="30px";
		
		
	}else{
		
		qj_dx.style.marginTop="120px";
		
	}
	
	
}


function mycz(dx,sy){
	var lsnr = dx.value;
	
	if(sy==1 && lsnr.length >0){

		JsBarcode("#tm1",lsnr,{
			height:30,
			width:1
		});
		qj_classdx[0].style.display="block";
		localStorage.setItem("zbx_tm1",lsnr);
		
	}
	
	if(sy==2 && lsnr.length >0){

		JsBarcode("#tm2",lsnr,{
			height:30,
			width:1
		});
		qj_classdx[1].style.display="block";
		localStorage.setItem("zbx_tm2",lsnr);
		
	}
	
}

function myqc(){
	
	for(var x=0;x<qj_classdx.length;x++){qj_classdx[x].style.display="none"}
	for (var i=0;i<qj_xsdx.length;i++){qj_xsdx[i].value="";}
	localStorage.setItem("zbx_tm1","");
	localStorage.setItem("zbx_tm2","");
	
	
}







